package com.example.demo.model;/*
 * Copyright © 2020-2035 erupt.xyz All rights reserved.
 * Author: YuePeng (erupts@126.com)
 */

import javax.persistence.*;
import xyz.erupt.annotation.*;
import xyz.erupt.annotation.sub_erupt.*;
import xyz.erupt.annotation.sub_field.*;
import xyz.erupt.annotation.sub_field.sub_edit.*;
import xyz.erupt.upms.model.base.HyperModel;
import xyz.erupt.jpa.model.BaseModel;
import java.util.Set;
import java.util.Date;

@Erupt(name = "设备")
@Table(name = "device")
@Entity
public class Device extends BaseModel {

        @EruptField(
                views = @View(
                        title = "设备编号"
                ),
                edit = @Edit(
                        title = "设备编号",
                        type = EditType.INPUT, search = @Search, notNull = true,
                        inputType = @InputType
                )
        )
        private String device_id;

        @EruptField(
                views = @View(
                        title = "设备名称"
                ),
                edit = @Edit(
                        title = "设备名称",
                        type = EditType.INPUT, search = @Search, notNull = true,
                        inputType = @InputType
                )
        )
        private String device_name;

        @EruptField(
                views = @View(
                        title = "设备mac地址"
                ),
                edit = @Edit(
                        title = "设备mac地址",
                        type = EditType.INPUT, search = @Search, notNull = true,
                        inputType = @InputType
                )
        )
        private String device_mac;

        @EruptField(
                views = @View(
                        title = "设备IP"
                ),
                edit = @Edit(
                        title = "设备IP",
                        type = EditType.INPUT, search = @Search, notNull = true,
                        inputType = @InputType
                )
        )
        private String device_IP;

        @EruptField(
                views = @View(
                        title = "设备状态"
                ),
                edit = @Edit(
                        title = "设备状态",
                        type = EditType.CHOICE, search = @Search, notNull = true,
                        choiceType = @ChoiceType(vl = {@VL(value = "online", label = "在线"), @VL(value = "offline", label = "离线")})
                )
        )
        private String devcie_status;

        @EruptField(
                views = @View(
                        title = "设备电量"
                ),
                edit = @Edit(
                        title = "设备电量",
                        type = EditType.SLIDER, search = @Search,
                        sliderType = @SliderType(max = 100, min = 0)
                )
        )
        private Integer device_electricity;

}